Defect inspection method and apparatus

ABSTRACT

Arrangements for inspecting a specimen on which plural patterns are formed; capturing a first image of a first area; capturing a second image of a second area in which patterns which are essentially the same with the patterns formed in the first area; creating data relating to corresponding pixels of the first and second images, for each pixel; determining a threshold for each pixel for detecting defects directly in accordance with the first and second images; and detecting defects on the specimen by processing the first and second images by using the threshold for each pixel and information of a scattered diagram of brightness of the first and second images, wherein the threshold is determined by using information of brightness of a local region of at least one of the first and second images, with the local region including an aimed pixel and peripheral pixels of the aimed pixel.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of application Ser. No.12/359,452, filed Jan. 26, 2009, which is a continuation application ofapplication Ser. No. 11/858,215, filed Sep. 20, 2007 (now U.S. Pat. No.7,512,259), which is a continuation application of application Ser. No.11/204,181, filed Aug. 16, 2005 (now U.S. Pat. No. 7,274,813), which isa continuation application of application Ser. No. 09/294,137, filedApr. 20, 1999 (now U.S. Pat. No. 6,947,587), based on Japanese PatentApplication No. 10-110383, filed in Japan on Apr. 21, 1998 and No.10-264275, filed Sep. 18, 1998, the contents of all of which areincorporated herein by reference in their entirety.

BACKGROUND OF THE INVENTION

The present invention relates to exterior inspection for detectingdefects of patterns being examined, and particularly to a defectinspection method and apparatus for inspecting patterns in asemiconductor wafer or liquid crystal display.

In a conventional inspection apparatus of this kind, as disclosed inJP-A-55-74409, an image sensor such as a line sensor is used to detectthe image of a pattern being examined while the pattern is being moved,and the detected image signal is compared in its gradation with anotherimage signal delayed by a predetermined time, so that the inconsistencyin the comparison can be recognized as a defect.

In addition, in another example disclosed in JP-2B-8-10463, two imagesare arranged in a row and compared with each other.

The above conventional defect recognition methods will be described indetail with reference to FIGS. 1, 2, 3 and 4. FIG. 1 is a schematicdiagram of memory mats and peripheral circuits in a memory chip of thepattern being inspected in the prior art. FIG. 2 is a histogram of thebrightness of the memory mats and peripheral circuits of the memory chipshown in FIG. 1.

FIG. 3 is a schematic diagram of a pattern being examined which patternis processed to be flat by CMP (chemical mechanical).

A semiconductor wafer has formed thereon a large number of memory chips20 one of which is illustrated in FIG. 1. The memory chip 20 can bedivided roughly into memory mats 21 and peripheral circuits 22. Each ofthe memory mats 21 is a group of small repetitive patterns (cells), andthe peripheral circuits 22 are fundamentally a group of random patterns.In most cases, if each memory mat is observed in detail, it can berecognized as a group of a plurality of patters repeated at differentcell pitches.

FIG. 2 illustrates the distribution of the brightness of the memory mats21 and peripheral circuits 22, in FIG. 1, or the frequency (histogram)with respect to the brightness of a memory chip expressed by ten bits,or in 1024 gradations, maximum. The memory mats 21 have a high patterndensity and are generally dark. The peripheral circuits 22 have a lowpattern density and are generally bright.

In the flattening process such as CMP shown in FIG. 3, the circuitpattern within the memory mat 21 changes the brightness with the patternthickness as will be understood from the histogram of FIG. 4. Thisfigure shows that the wiring layers are deposited and then flattened byCMP. In this pattern, the film thickness locally changes, easily causingirregular brightness. In the case of such a pattern, the brightnessvalues on the pattern shown in FIGS. 2 and 3 are compared. If athreshold is set not to erroneously detect the brightness difference,the sensitivity to defect detection is extremely reduced. Thisbrightness difference can be cancelled out to some extent if a widewavelength band is used for illumination. However, because the patternafter CMP has sometimes a great change in brightness, there is a limit.Therefore, it has been desired to devise means for detecting minutedefects from a pattern having irregular brightness.

Also, in a conventional example, the sum of the squares of thedifferences between corresponding parts of two pictures is calculatedand applied to a paraboloid so that a positional shift between thepictures can be detected. This method, however, does not assure that thetwo images to be compared are coincident. Thus, optimum matching hasbeen desired for the comparison. FIG. 5 shows experimental results ofcalculating the sum of the squares of the differences of opposite pixelsof two pictures (f(x, y) in FIG. 13 in the later description) of whichone picture is shifted by ±1 pixel in the x and y directions. Theabscissa indicates the x direction, and the ordinate the y direction.Each value illustrated in the figure is the sum of the squares of thedifferences. Here, the same pictures (f(x, y) in FIG. 13) are used. Thatis, Σ (f(x, y)−f(x±1, y±1))2 is calculated as the sum of the squares ofthe differences. From FIG. 5 it will be seen that the sums of thesquares of the differences even between the same pictures are notsymmetrical with respect to the center (0, 0), or have an asymmetry ofabout 0.6%. Since the same pictures one of which is shifted are used,the sum of the squares of the differences is 0 at the point (0, 0).Therefore, even if the position where the sum of the squares of thedifferences is the minimum is calculated with a resolution of pixel sizeor below by applying a paraboloid to this data, a correct positionalshift, or (0, 0) here cannot be detected.

Also, brightness is changed on the wafer after the flattening processsuch as CMP. The effect of this brightness change is illustrated in FIG.6. Here, two pictures are used one of which has 1.1 times the brightnessof the other. The brightness 1.1 times higher corresponds to the usualbrightness change on the CMP wafer or below. Each value in theexperimental results of FIG. 6 is the sum of the absolute values of thedifferences. The position where the minimum value is located is (0, 1).Thus there is a great error in terms of pixel level contrary to theresolution of pixel or below. The sum of the squares of the differenceshas the same tendency. From these data, it will be understood that thepositional shift between pictures cannot be found precisely. Of course,for the brightness 1.05 times higher there is the same tendency. Thus,applying a paraboloid to the sum of the squares of the differences andcalculating the position where the minimum value is obtained must besaid to be means having very large error.

SUMMARY OF THE INVENTION

Accordingly, it is an object of the invention to provide a patterndefect inspection method and apparatus with the above problems solved,and capable of examining by comparing patterns of different brightnessso that defects can be inspected with high sensitivity and highreliability at all times.

In addition, it is another object of the invention to provide a patterndefect inspection method and apparatus using a high-precision picturematching process.

Moreover, it is still another object of the invention to provide apattern defect inspection method and apparatus capable of detecting withhigh sensitivity even for a wafer pattern after CMP.

In order to achieve the above objects, according to the invention, thereis provided a method of inspecting defects of a plurality of patternsformed to be naturally the same on a substrate, wherein a first patternbeing inspected is detected as a first image which is then stored, asecond pattern being inspected is detected as a second image, and thesecond image is matched in brightness to the first image stored, andthen compared with the first image so that the patterns can beinspected.

Moreover, according to the invention, there is provided a method ofinspecting defects of a plurality of patterns formed to have naturallythe same shape and flattened in their surfaces, wherein a first patternbeing inspected is optically picked up as a first image signal andstored, a second pattern being inspected is optically picked up as asecond image signal, at least one of the first image signal stored andthe second image signal is locally changed in gradation, and the firstand second image signals are compared so that the patterns can beinspected.

In addition, according to the invention, there is provided a method ofinspecting defects of a plurality of patterns formed to be naturally thesame on a substrate, wherein a first pattern being inspected is detectedas a first image and stored, a second pattern being inspected isdetected as a second image, the first image stored and the second imageare corrected for their positional shift with an accuracy of pixel unit,the brightness of one or both of the corrected first and second imagesis changed, the first and second images changed in brightness as aboveare compared so that the inconsistency between the first and secondimages is detected as a defect, and the detected result is displayed.

Thus, according to the invention, the certainty of inconsistentinformation can be judged by using a scatter diagram of two detectedimages to be compared. In addition, since defects are detected by usinginformation from the scatter diagram, the inspection can be made highlyreliable. Moreover, use of the scatter diagram makes it possible todecide an appropriate threshold. Also, by using the certainty ofinconsistent information, it is possible to effectively make defectreview.

Therefore, reliable inspection data can be used by adding reliability.Furthermore, defects can be detected with high sensitivity withoutreducing the total inspection sensitivity by the brightness differencedue to the change of the film thickness of a multilayer pattern.Therefore, in the manufacturing process of semiconductor devices,defects of patterns of a wafer after CMP can be detected with highprecision and high reliability.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic of the memory mats and peripheral circuits in amemory chip of which the pattern is to be inspected.

FIG. 2 is a histogram of brightness in the memory mats and peripheralcircuits of the memory chip.

FIG. 3 is a diagram to which reference is made in explaining the flow ofCMP.

FIG. 4 is a histogram of brightness in the memory mats and peripheralcircuits of a different memory chip after CMP.

FIG. 5 is a diagram showing the sum of the squares of the differencesbetween two pictures.

FIG. 6 is a diagram showing the sum of the absolute values of thedifferences between two pictures.

FIGS. 7 and 8 are block diagrams of pattern defect inspection apparatusaccording to one embodiment of the invention.

FIG. 9 is a detailed block diagram of an image brightness coincidencefilter operation unit 12 in FIGS. 7 and 8.

FIG. 10 shows an example of a twin filter.

FIG. 11 is a diagram to which reference is made in explaining theoperation of the image brightness coincidence filter operation unit 12.

FIG. 12 is a detailed block diagram of a local gradation converter 13.

FIGS. 13A-13C show examples of detected images and difference imageaccording to the invention.

FIGS. 14A-14B, 15A-15B, 16A-16B, 17A-17B and 18A-18B show examples ofthe gradation conversion according to the invention.

FIGS. 19 and 20 are diagrams to which reference is made in explainingthreshold setting systems.

FIGS. 21-23 are scatter diagrams of local contrast at each imageprocessing step on two pictures being compared.

FIG. 24 is a block diagram of a pattern defect inspection apparatusaccording to another embodiment of the invention.

FIG. 25 is a block diagram of a threshold computation circuit 48.

FIG. 26 is a block diagram of a pattern defect inspection apparatusaccording to another embodiment of the invention.

FIG. 27 is a diagram to which reference is made in explaining thescatter diagram production 24 and display 25 according to the embodimentof the invention.

FIGS. 28 and 29 are diagrams showing the results at each imageprocessing on two pictures being compared.

FIGS. 30-32 are scatter diagrams at each image processing step on twoimages being compared.

FIGS. 33-37 are examples of scatter diagrams.

FIG. 38 is a partially cross-sectional block diagram of a pattern defectinspection apparatus according to still another embodiment of theinvention.

FIG. 39 is a diagram showing the scatter diagram production and displayaccording to the embodiment of the invention.

FIGS. 40A and 40B are diagrams to which reference is made in explainingthe local gradation conversion according to the embodiment of theinvention.

FIG. 41 is a block diagram to which reference is made in explaining thescatter diagram production and display according to the embodiment ofthe invention.

FIG. 42 is a diagram showing the results at each image processing stepon two pictures being compared.

FIGS. 43A and 43B are scatter diagrams.

FIGS. 44A-44C show examples of output lists for defects.

FIG. 45 is a diagram to which reference is made in explaining the amountof positional shift between pictures.

FIG. 46 is a diagram to which reference is made in explaining spectrumanalysis.

DESCRIPTION OF THE EMBODIMENTS

Some embodiments of the invention will be described with reference tothe accompanying drawings.

Embodiment 1

FIGS. 7 and 8 are block diagrams of pattern defect inspection apparatusaccording to the first embodiment of the invention.

It is assumed that this embodiment inspects, for example, patterns of asemiconductor wafer.

Referring to FIGS. 7 and 8, there are shown an image sensor 1 thatresponds to the brightness or gradation of light reflected from asemiconductor wafer 4 of patterns being inspected to produce a gradationimage signal, an A/D converter 2 for converting the gradation imagesignal from the image sensor 1 into a digital image signal 9, a delaymemory 3 for delaying the gradation image signal, and the semiconductorwafer 4 having patterns being inspected. There are also shown a stage 5that is moved in X-direction, Y-direction, Z-direction and θ-direction(rotation) with the semiconductor wafer 4 placed thereon, an object lens6 facing the semiconductor wafer 4, a light source 7 for illuminatingthe semiconductor wafer 4 of the patterns being inspected, a half mirror8 for reflecting the illumination light and supplying it through theobject lens 6 to the semiconductor wafer 4 and at the same time allowingthe reflected light from the semiconductor wafer 4 to permeatetherethrough, and the digital image signal 9 into which the gradationimage signal is converted by the A/D converter 2. Thus the light fromthe light source 7 for illumination is reflected to provide, forexample, bright field illumination on the semiconductor wafer 4 throughthe object lens 6.

The delay memory 3 may be a delay memory for storing and delaying imagesignal 9 of a one-cell pitch or plurality-of-cells pitch repeated or maybe another delay memory for storing and delaying image signal 9 of aone-chip pitch or plurality-of-chips repeated.

In addition, a block 11 is used to align the digital image signal 9 anda delayed digital image signal 10, or here to detect the amount of shiftat which the minimum gradation difference can be obtained with aprecision of pixel unit, and shift one picture on the basis of thisamount of shift so as to align the two pictures. Here, the images arecontinuously detected by the image sensor, but divided at, for example,each 256 lines (the number of lines is determined according to themethod described later), and the images of this unit are aligned. Ablock 12 is a brightness converter for converting both image signalsthat are different in brightness so that the brightness of one imagesignal equals to that of the other. Here, all the images are passedthrough a filter at a time so that the brightness of one image coincideswith that of the other.

A block 13 is a gradation converter for converting the gradations ofboth image signals that are different in brightness so that thebrightness of one image can be coincident with that of the other. Here,linear conversion is performed for each pixel by gain and offset so thatthe brightness coincidence can be achieved. The image signals from thegradation converter 13 are compared by a comparator 14, and theinconsistency can be detected as a defect.

The detected image signal is serially processed by a pipeline-type imageprocessing system, and finally a defect and its features are produced.

Although bright field illumination is employed in the above example, thelight source is not limited thereto, but may be an arbitrary one if itcan be used as microscope illumination such as dark field illuminationor ring band illumination. The illumination by an electron beam can beof course used.

The inspection may be performed a plurality of times with theseillumination conditions changed so that the logical sum of the resultsfrom the plurality of inspection operations can be employed as the finalresult. Alternatively, it is possible that the logical product thereofis employed to assure the defect and that process diagnosis may be madeby, for example, the distribution of defects or number of defects. Inthis case, the review for visual observation of inconsistent portions isnot necessary, and thus the operation can be simplified and facilitated.

The operation of the inspection apparatus constructed as above will bedescribed with reference to FIGS. 7-12. The order of processes in FIG. 7is different from that in FIG. 8.

Referring to FIGS. 7 and 8, the stage 5 is moved at a constant speed inthe X-direction so that the illumination light focused by the objectlens 6 scans the necessary region of the patterns of semiconductor wafer4 being inspected, while the image sensor 1 detects the brightnessinformation (gradation image signal) of the pattern formed on thesemiconductor wafer 4, or of the memory mats 21 and peripheral circuits22 within the chip 20.

After the completion of one-row movement, the stage 4 suddenly moveswith high speed to the next row in the Y-direction and positions itself.In other words, uniform movement and fast movement are repeated for theinspection. Of course, step and repeat type inspection may be performed.Then, the A/D converter 2 converts the output (gradation image signal)from the image sensor 1 into the digital image signal. This digitalimage signal 9 has a format of 10 bits. Although the image processingcan be well performed without particular problem even if the signal hasabout 6 bits, a certain number of bits larger than that is necessary forthe detection of minute defects.

First the pixel-unit alignment between images will be mentioned. In thisalignment, one of two pictures to be compared is shifted pixel by pixelfrom the other while the gradation difference (the difference betweeneach pixel of one picture and the corresponding pixel of the other) iscalculated, and the amount of shift at which the gradation difference isthe minimum is found. The range of shift between pictures to be detectedis set, for example, within ±3 pixels, maximum but changed according tothe design rule of pattern. Thus, the two pictures are aligned byshifting one picture by the obtained amount of shift.

A method for the alignment will be described below.

S(Δx,Δy)=Σ|f(x,y)−g(x−Δx,y−Δy)|  (1)

The shift detection is performed by detecting Δx, Δy when the aboveS(Δx, Δy) becomes the minimum.

However, since the position satisfying the minimum is obtained only whenthe picture is shifted pixel by pixel, this position is added with anoffset depending on whether the true position is near to Δx or Δy.

According to the expressions given below, Δx and/or Δy are added with 1or nothing, that is,

if S(1,0)+S(1,−1)+S(0,−1) is the minimum, then Δx++  (2)

if S(−1,0)+S(−1,−1)+S(0,−1) is the minimum, then nothing  (3)

if S(−1,0)+S(−1,−1)+S(0,1) is the minimum, then Δy++  (4)

and if S(−1,0)+S(1,1)+S(0,1) is the minimum, Δx++,Δy++  (5)

where Δx++ means Δx=Δx+1.

Thus, two pictures can be always aligned by shifting one picture by theobtained amount of shift. In other words, a picture f is always shiftedto the upper right to be a new picture f′. The movement direction can belimited to one of four directions (lower right, upper left, lower leftand upper right). This leads to the simplification of hardware.

FIG. 9 is a detailed block diagram of the brightness coincidence filteroperation unit 12. First, filters F, F′ are found that make thefollowing expression the minimum within two pictures f(x, y), g(x, y)that are aligned with accuracy of pixel unit.

Σ(F*f(x,y)−F′*g(x,y))²  (6)

The filters F, F′ have a size of for example 2×2 pixels.

FIG. 10 shows examples of filters. The filters F and F′ are symmetrical,and a twin as illustrated. If the filters are of the twin type, thecoefficients of the filter parameters can be solved by using the methodof least squares.

α=|(ΣΣC0*Cy)*(ΣΣCx*Cy)−(ΣΣC0*Cx)*(ΣΣCy*Cy)|/|(ΣΣCx*Cx)*(ΣΣCy*Cy)−(ΣΣCx*Cy)*(ΣΣCx*Cy)|  (7)

β=|(ΣΣC0*Cx)*(ΣΣCx*Cy)−(ΣΣC0*Cy)*(ΣΣCx*Cx)|/|(ΣΣCx*Cx)*(ΣΣCy*Cy)−(ΣΣCx*Cy)*(ΣΣCx*Cy)|  (8)

where

C0=f(x,y)−g(x,y)  (9)

Cx=|f(x+1,y)−f(x,y)|−|g(x−1,y)−g(x,y)|  (10)

Cy=|f(x,y+1)−f(x,y)|−|g(x,y−1)−g(x,y)|  (11)

This system filters the two pictures and makes the square error of thegradation the minimum to reach coincidence. No repetitive computationsare necessary, or a single calculation is made to achieve the object.

The feature of this system is that the filter coefficients α, β arefound so that the gradations of two pictures can be well coincident interms of square error minimum. Particularly, these parameters do notnecessarily indicate the true amount of shift of picture. For example,as described about the prior art it can be considered to apply aparaboloid to S(Δx, Δy), calculate the minimum gradation differenceposition, and then find interpolating pixels by interpolation on thebasis of this calculated position. In this case, there is no rule orconditions to be met for the brightness, and thus it is not guaranteedto use the obtained pictures for the comparative inspection. Inaddition, under a different brightness, it is not clear what thecomputed shift shows. In addition, even if the minimum gradationdifference position calculated approximately to a paraboloid iscoincident with that obtained according to the system used in thisembodiment, the produced pictures to be compared are not coincident.

The proposed matching system assures that the difference between thesquares of the brightness values of two pictures becomes the minimum.Thus, in this point this system is different from the other systems. Asillustrated in FIG. 11, because of linear approximation, the coefficientα of filter has error for a positional shift. However, the obtainedbrightness values are coincident. This system can substantially reducethe gradation difference between images, and thus it is much appropriatefor the comparative and inspection.

Moreover, the filter coefficients α, β can be calculated analyticallywithout repetitive computation, and thus this system is suitable to beformed as certain hardware.

FIG. 12 is a detailed block diagram of the local gradation converter 13.The two pictures f(x, y), g(x, y) that are aligned with accuracy ofpixel unit and produced from the brightness coincidence filter operationunit are processed so that parameters a, b (a: gain, b: offset) can beproduced which make the following expression the minimum within acertain area of the pictures.

Σ(f(x,y)−a*g(x,y)−b)²  (12)

The parameters a, b can be calculated by partially differentiating theabove expression with respect to a, b and making the resultingexpression equal to zero. For example, the certain area is a range of 7around each point.

The g(x, y) as one of the image signals is converted by use of theobtained parameters into

a*g(x,y)+b  (13)

Thus, pictures coincident in bright can be obtained. The parameters a, bcan take different values for each position (x, y).

a=(Σ(f(x,y)g(x,y))·Σf(x,y)Σg(x,y)/MN)/(Σg(x,y)g(x,y)−Σg(x,y)Σg(x,y)/MN)  (14)

b=(Σf(x,y)−aΣg(x,y))/MN  (15)

where MN is the number of pixels in the range of Σ.

In addition, within the rang of Σ, the brightness of the aimed centerpixel is compared with that of the surrounding pixels. If the brightnessvalues of those pixels are greatly different, it will be better not toadd those values.

Alternatively, the addition itself is made, but it will be effective toweight the values before the addition, thereby lowering percentcontribution. For example, if the brightness of the aimed pixel at (x,y) is represented by c, and that of another pixel within the range of Σby d, then the weight (x, y) can be expressed by

W(x,y)=max[1−(c−d)²/(D*D),0]  (16).

where max[ ] is the maximum value detection, the brightness c, d is of 8bits gradation, and D is a constant.

Thus, if the brightness of the aimed center pixel is similar to that ofthe surrounding pixels, the weight is selected to be substantially equalto 1. If it is not similar, the weight is smaller than 1. Although D isa constant, it may be changed according to the brightness, or D=func(c). Moreover, decision is made of whether or not the pixel belongs tothe same pattern. If the average brightness of different patterns isrepresented by μ, D may be given by D=|c−μ|. If there are three or moredifferent patterns, D may be selected to be the difference betweensimilar patterns. Of course, it is not necessary to stick to this form.Other means may be used if weights are properly provided.

FIGS. 13A and 13B show examples of two detected images. The two detectedimages f(x, y), g(x, y) have different brightness as illustrated. Thetwo images were aligned with precision of pixel unit, and subjected tothe brightness coincidence filter operation. However, since these imageshave an excessively large difference in brightness, a greatinconsistency is caused in the difference image as illustrated in FIG.13C. This image was subjected to the gradation conversion process.

FIGS. 14A˜16B show examples of the process. That is, FIGS. 14A˜16A and14B˜16B illustrate two detected images g(x, y), f(x, y), converted imagea*g(x, y)+b, and their brightness histograms, respectively. Here, D wasselected to be 70, or D=70.

As will be understood from the histogram shown in FIG. 14B, the value Dcorresponds to the difference between the average brightness values ofthe two distributions of the double hump response histogram. In otherwords, the weight W with this D serves as an index for indicatingwhether or not the brightness belongs to the same distribution. Thedecided area is the range of 7×7 pixels around each point. From FIGS.14A˜16B, it will be seen that the brightness histograms are madesubstantially equal by the conversion. Here, after the experiment on theimages shown in FIGS. 14A˜16A, the parameters a, b of a=1.41, b=0 wereobtained at certain points within the images. In addition, it will beunderstood that the brightness gains in the images are greatly different(41%).

From the above example, it can be considered that the offset b is alwaysfixed to 0, and that the gain is made variable. The offset and gain maybe determined according to the characteristics of patterns to beconsidered and apparatus structure.

FIGS. 17A, 17B and 18A, 18B show the differences between the imagesobtained by the conversion. In the first three images of FIGS. 17A, 17Band 18A, 18B, the decided areas are the ranges 3×3, 5×5, 7×7 around eachpoint. At this time, the weight is equal to 1, or W(x, y)=1. Inaddition, in the last image, the decided area is the range 7×7, and theweight depends on the above-mentioned W(x, y). From these figures, itwill be seen that when the area is small, the brightness values arelocally added and that the inconsistency between images becomes small.The allowance of brightness is extended, but minute defects will bemissed. Therefore, it is necessary to spread the area according to thedefects being detected. However, if the weight is fixed to 1, theboundary between the patterns will be detected as inconsistency, orfalse report. If weighting is made, the effect of the boundary isreduced, two images are substantially equal in brightness, and a minutedefect can be detected.

The area such as 7×7 pixels is not necessarily square, but may be arectangle, polygon or circle. The area is not limited to such very smallregions, but may be a region as large as (hundreds of pixels)×(hundredsof pixels). In short, the area may be within a range in which thebrightness variation can be absorbed.

The weight can also be selected to be 0 when the brightness differencebetween the aimed center pixel and the peripheral pixels is larger thana threshold.

In addition, the following gradation conversion can be considered.

W(x,y)(σ_(f)/σ_(g))(g(x,y)−m_(g))+m_(f)  (17)

where σ_(f), σ_(g) and m_(f), m_(g) are the standard deviation andaverage value within a certain area near a point (x, y) in the imagef(x, y), g(x, y), respectively.

By the above conversion, it is possible to make the brightness of theimage g(x, y) coincident with that of the image f(x, y).

The weight W(x, y) may be the above values or correlation coefficientsof image data within a certain area in the images f(x, y) and g(x, y).

This system has a feature that the histograms of two images eventuallycoincide with each other.

Either system takes a linear conversion form of gain and offset.

The above-mentioned gradation conversion is the local brightnessconversion in the vicinity of the aimed pixel. Of course, the gradationconversion may be applied to the whole image, or here to all the 256lines according to the object and image characteristics. In addition,when the brightness of one of two images is made coincident with that ofthe other, the brightness of a brighter image can be decided to use as areference by calculating, for example, the average brightness values ofeach two images, and comparing them, or by calculating the averagebrightness values of each certain areas or points.

Although the gradation conversion is executed after the image brightnesscoincidence filter operation as in FIG. 7, this order may be reversed asin FIG. 8.

The comparator 14 may be the means shown in the system developed by theinventors and disclosed in JP-A-61-212708. This comparator is formed ofa difference image detector, an inconsistency detector for convertingthe difference image into a binary signal on the basis of a threshold,and a feature extraction circuit for calculating an area, a length(projection length), coordinates and so on from the binary output.

The selection of a threshold for use in the conversion to binary valuesaccording to the invention will be further described with reference toFIGS. 19 and 20.

When a difference image is converted into a binary signal, false reportis easy to occur at the boundary between regions as described above.Thus, as illustrated in FIG. 19, the detected image is processed at eachpoint to produce by computation a difference between the maximum and theminimum, an average value and a larger one of the differentiated valuesof x, y (hereinafter, referred to as local data) within a local region.These produced values are multiplied by separately determinedparameters, and added, or subjected to the so-called multiplicationaddition calculation, thereby generating a threshold. Accordingly, sincethe differentiated values increase at, for example, the boundary betweenregions where the brightness change is large, the threshold increases,thus preventing the false report from being caused. Of course, it is notnecessary to provide all the three values of the difference between themaximum and the minimum, the average value and the large one of thedifferentiated values of x, y, but only one may be produced. Forexample, if the gradation conversion is performed, the average value isnot necessary to compute.

If the difference between images is converted into a binary signal byusing the threshold, the false report problem can be effectivelyreduced. The local data can be obtained more easily by findingdistributions from the scatter diagram described later. FIGS. 21˜23 showscatter diagrams of the difference between the maximum and the minimumwithin a local region of images. A line segment is drawn on thisdistribution data, and error from the line segment is found. Thisprocess is executed for each local data, and then a threshold can bedetermined by the multiplication and addition.

For example, it is assumed that the threshold Th is calculated from thefollowing equation.

Th=C3×(local contrast)+C2×(average brightness).

where the local contrast image is defined by the maximum minus theminimum of 3×3 pixels, and the average brightness image is expressed bythe moving average of 3×3 pixels.

The two local contrast images to be compared are represented by f(x, y),g(x, y), and Ve calculated from

$\begin{matrix}{{Ve} = {\frac{1}{{\left( {{2\; {dx}} + 1} \right) \cdot \left( {{2\; {dx}} + 1} \right)} - 2}{\sum\limits_{x = {{- {dx}}\; 1}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {{g\left( {x,y} \right)} - \left( {{m \cdot {f\left( {x,y} \right)}} + n} \right)} \right)^{2}}}}} & (18)\end{matrix}$

is made equal to σk.

Similarly, the brightness average images are represented by f(x, y),g(x, y), and the calculated Ve is made equal to σa.

Thus, the following equation (19) can be determined.

σg=C3×σk+C2×σa  (19)

The same is done for another image. Thus, coefficients C2, C3 can befound.

In order to solve the above equation of Th, the standard deviation σk isdetermined which is the distance from a straight line of gradient 1(m=1), interception 0 (n=0) to each plot data point in the localcontrast scatter diagram and which corresponds to error. Similarly, thestandard deviation σa is found which is the distance from a straightline of gradient 1, interception 0 to each plot data point in thescatter diagram of average brightness, and which corresponds to error.In addition, the standard deviation σg is estimated which is thedistance from a straight line of gradient 1, interception 0 to each plotdata point in the brightness scatter diagram of the two original images,and which corresponds to error.

These values are substituted into the above equation Th, giving rise toan equation having C2 and C3 like the equation (19). This operation isperformed for images at different points, thus producing other equationsof different coefficients C2 and C3. These equations are solved assimultaneous equations, so that coefficients C2, C3 are definitelydetermined. Thus, the threshold Th can be calculated from the aboveequation with known C2, C3. Of course, the threshold Th may be given by

Th=C3×(local contrast)+C2×(average brightness)+offset.

For another setting system, the floating threshold to be estimated maybe given by the following equation (20) that is a linear connection oflocal brightness contrast and average values. The parameters arecalculated by multiple regression analysis with reference to the scatterdiagram information of two pictures being compared.

Th=C0+C1×| f−g|+C2×| f|+C3×|f′|+C4×| f|  (20)

The procedure for the setting will be given below.(1) Detect images at a plurality of points (a set of two chips).(2) Generate a brightness scatter diagram from data of detected imageand reference image (using images not including defects or images withdefects removed).(3) Find points enveloping a set of data in the scatter diagram (extracta point of frequency 1 in estimation), and extract local contrast andaverage data from the pixels of image corresponding to the points.(4) Adjust the parameters C0˜C4 by multiple regression analysis on thebasis of the information obtained by the step (3).(5) Select data to be used according to p value (significance level)(find a combination in which the p value is a much reliable value (0.05or below)).(6) Calculate threshold images from the estimated parameters C0˜C4, andcompare with difference images.(7) Add false report if present, and adjust the parameters C0˜C4.(8) Make a test inspection.(9) Repeat the steps (7) and (8) if a false report occurs.

In addition, as shown in FIG. 20, look-up tables (LUTs) may be used inplace of the multiplication addition operation of coefficients and errormentioned above. As illustrated in FIGS. 19 and 20, the detected imageis processed to produce local maximum values and local minimum values,and the contrast of the difference therebetween, and then fed to theLUT. Similarly, the detected image is processed to produce a localaverage value, and fed to the LUT. The outputs from these LUTs aresupplied to another LUT, thereby producing a threshold. The circuitarrangements shown in FIGS. 19 and 20 limit the number of bits beingused to 8→6 in order for the scale of the LUTs to be appropriate. Theestimated threshold is supplied to the comparator (FIGS. 7 and 8) 14,where it is used as a threshold for the conversion to a binary signal.The data of the contents of the LUTs are produced by using variousimages which are processed by the same procedure as above to produceerror which is then interpolated.

The images to be selected are of course in the place where error is easyto detect. The prior art does not use this way of deciding. The featureof the present invention is not only the establishment of the procedurebut also theoretical decision.

Referring to FIGS. 7 and 8, input means 15 formed of a keyboard, a diskor the like supplies to a CPU 16 coordinates of array data within thechips on the semiconductor wafer 4 which are obtained from the designinformation. The CPU 16 generates defect inspection data on the basis ofthe inputted coordinates, and supplies it to a memory 17.

This defect inspection data can be indicated on display means such as adisplay or supplied to the outside from the output means.

In addition, the operator can visually confirm that the gradationconversion is properly made for inspection by displaying the imagebefore the gradation conversion or image data and image after thegradation conversion or image data or by displaying image after thegradation conversion or image data.

Thus, images can be compared with high precision, and the object of theinvention can be achieved with high sensitivity.

While this embodiment employs bright field illumination, the imagesobtained by dark field illumination can be used for the inspection.Also, the kinds of defects can include defective shapes such asshort-circuits or open-circuits or other foreign bodies.

Embodiment 2

FIG. 24 shows the second embodiment of a pattern inspection method andapparatus according to the invention. In this embodiment, an electronbeam is used to scan the sample and the electrons generated from thewafer by the irradiation of the electron beam are detected. An electronbeam image of the scanned region is thus obtained on the basis of thechange of the intensity, and used to make a pattern inspection. Thesecond embodiment overcomes the problems to be solved by the inventionby setting a defect decision threshold for each pixel consideringpattern shift and different gradations.

This system includes a detection unit 101, an image extractor 102, animage processor 103, a whole controller 104 for controlling the wholesystem.

The detection unit 101 will be described first.

Referring to FIG. 24, an electron beam emitted from an electron gun 31passes through a magnetic field lens 32 and an object lens 33 andfocused on the sample surface to an extent of about pixel size indiameter. In this case, a negative potential is applied to the sample bya ground electrode 37 and a retarding electrode 38 to decelerate theelectron beam between the object lens and the sample, thereby achievinghigh resolution in the low-acceleration voltage region. When theelectron beam is irradiated on the sample, the sample (wafer 1) emitselectrons. A deflector 34 deflects the electron beam so that theelectron beam repeatedly scans the sample in the X-direction, and at thesame time the sample is continuously moved in the Y-direction with thestage 2. The sample generates electrons in synchronism with therepetitive X-direction scanning and the continuous Y-direction movement,thus producing a two-dimensional electron beam image of the sample. Theelectrons emitted from the sample are caught by a detector 35, and thesignal is amplified by an amplifier 36.

In this system, it is desired that a fast-deflection static deflector beused for the deflector 34 for permitting the electron beam to repeatedlyscan in the X-direction, that a thermal field emission type electron gunthat can emit a large electron beam current and thus reduce theirradiation time be used as the electron gun 31, and that asemiconductor detector capable of fast driving be used for the detector35.

The image extractor 102 will be described next.

The amplified signal from the amplifier 36 is converted into a digitalsignal by an A/D converter 39, and fed to a pre-processor 40. Thepre-processor makes the input signal be subjected to dark levelcorrection (the dark level is the average of the gradations ofparticular pixels during the beam blanking period),electron-beam-current fluctuation correction (the beam current isdetected by an object diaphragm not shown and the signal is normalizedby the beam current), and shading correction (correction for thevariation of light intensity due to beam scan position). Thereafter, inthe pre-processor, the signal is subjected to filtering process by aGaussian filter, an averaging filter or a edge emphasizing filter sothat the picture quality can be improved. If necessary, image distortionis corrected. This pre-processing is made for the detected image to beconverted favorably to the later defect decision processing.

A delay circuit 41 delays the signal by a constant time. If the delaytime is made equal to the time in which the stage 52 is moved byone-chip pitch, the delayed signal g0 and the non-delayed signal f0become the image signals at the same locations of the adjacent chips,and thus can be used for the previously mentioned chip comparativeinspection. Alternatively, if the delay time is set to correspond to thetime in which the stage 5 is moved by the pitch of memory cell, thedelayed signal g0 and the non-delayed signal f0 become the image signalsat the same locations of the adjacent memory cells, and thus can be usedfor the previously mentioned cell comparative inspection.

Thus, the image extractor 102 produces the image signals f0 and g0 beingcompared. Hereinafter, f0 is referred to as the detected image, and g0as the compared image.

The image processor 103 will be described.

A pixel-unit aligner 42 shifts the compared image so that the locationat which the “degree of matching” between the detected image as areference and the compared image is the maximum lies within 0˜1 pixel.

Then, the filters F, F′ in the brightness coincidence filter operationunit are determined to make the brightness inconsistency between theimages the minimum. As described above, it is necessary to estimatevarious different statistics ΣΣxx in order to solve the equations (7),(8) for the parameter coefficients dx0, dy0 of filters by the method ofleast squares. A statistics calculator 44 computes various statisticsΣΣxx, and a sub-CPU 45 receives the statistics and calculates α, β fromthe equations (7), (8).

A local gradation converter 46 makes gradation conversion, permittingthe above-mentioned f1 and g1 to coincide in brightness.

A difference extractor 49 estimates a difference image sub(x, y) betweenf1 and g1. That is, the following equation is satisfied.

sub(x,y)=g1(x,y)−g1(x,y)  (21)

A threshold calculator 48 receives the image signals f1, g1 producedfrom the local gradation converter 46 and α, β, and computes twothresholds thH(x, y) and thL(x, y) by which decision is made if thedifference image sub(x, y) has a defect. The threshold thH(x, y)regulates the upper limit of the sub(x, y), and the threshold thL(x, y)does the lower limit of the sub(x, y). FIG. 25 shows the arrangement ofthe threshold calculator 48. The equations for the calculation in thethreshold calculator will be given below.

$\begin{matrix}{{{thH}\left( {x,y} \right)} = {{A\left( {x,y} \right)} + {B\left( {x,y} \right)} + {C\left( {x,y} \right)}}} & (22) \\{{{{thL}\left( {x,y} \right)} = {{A\left( {x,y} \right)} - {B\left( {x,y} \right)} - {C\left( {x,y} \right)}}}{{in}\mspace{14mu} {which}}} & (23) \\\begin{matrix}{{A\left( {x,y} \right)} = {{{{{dx}\; 1\left( {x,y} \right)*\alpha} - {{dx}\; 2\left( {x,y} \right)*\left( {- \alpha} \right)}}} +}} \\{{{{{dy}\; 1\left( {x,y} \right)*\beta} - {{dy}\; 2\left( {x,y} \right)*\left( {- \beta} \right)}}}} \\{{{{= {{{dx}\; 1\left( {x,y} \right)} + {{dx}\; 2\left( {x,y} \right)}}}}*\alpha} +} \\{{{{{dy}\; 1\left( {x,y} \right)} + {{dy}\; 2\left( {x,y} \right)}}}*\beta}\end{matrix} & (24) \\\begin{matrix}{{B\left( {x,y} \right)} = {{{{{dx}\; 1\left( {x,y} \right)*{\alpha\alpha}} - {{dx}\; 2\left( {x,y} \right)*\left( {- {\alpha\alpha}} \right)}}} +}} \\{{{{{dy}\; 1\left( {x,y} \right)*{\beta\beta}} - {{dy}\; 2\left( {x,y} \right)*\left( {- {\beta\beta}} \right)}}}} \\{{{{{{{{dx}\; 1\left( {x,y} \right)} + {{dx}\; 2\left( {x,y} \right)}}}*{\alpha\alpha}}} +}} \\{{{{{{{dy}\; 1\left( {x,y} \right)} + {{dy}\; 2\left( {x,y} \right)}}}*{\beta\beta}}}}\end{matrix} & (25) \\{{C\left( {x,y} \right)} = {{{\left( {{\max \; 1} + {\max \; 2}} \right)/2}*\gamma} + ɛ}} & (26)\end{matrix}$

where aa, bb are real numbers of 0˜0.5, γ is a real number larger than0, and ε is an integer larger than 0.

$\begin{matrix}\left. \begin{matrix}{{{dx}\; 1\left( {x,y} \right)} = {{f\; 1\left( {{x + 1},y} \right)} - {f\; 1\left( {x,y} \right)}}} \\{{{dx}\; 2\left( {x,y} \right)} = {{g\; 1\left( {x,y} \right)} - {g\; 1\left( {{x - 1},y} \right)}}} \\{{{dy}\; 1\left( {x,y} \right)} = {{f\; 1\left( {x,{y + 1}} \right)} - {f\; 1\left( {x,y} \right)}}} \\{{{dy}\; 2\left( {x,y} \right)} = {{g\; 1\left( {x,y} \right)} - {g\; 1\left( {x,{y - 1}} \right)}}} \\{{\max \; 1} = {\max {{{f\; 1\left( {x,y} \right)},{f\; 1\left( {{x + 1},y} \right)},{f\; 1\left( {x,{y + 1}} \right)},{f\left( {{x + 1},{y + 1}} \right)}}}}} \\{{\max \; 2} = {\max {{{g\; 1\left( {x,y} \right)},\; {g\; 1\left( {{x - 1},y} \right)},{g\; 1\left( {x,{y - 1}} \right)},{g\left( {{x - 1},{y - 1}} \right)}}}}}\end{matrix} \right\} & (27)\end{matrix}$

The first term A(x, y) of the right side of equations (22), (23) for thecalculation of thresholds is provided for correcting the threshold inaccordance with α, β estimated by the shift detector 43. For example,dx1(x, y) expressed by equation (27) is regarded as a local rate ofchange in the x-direction of the gradation of f1, and dx1(x, y) (α is aprediction value of change of the gradation of f1 shifted by α. Thus,the first term, {dx1(x, y)*α−dx2(x, y)*(−α)} of A(x, y) is a predictionvalue of how the gradation of the difference image between f1 and g1 ischanged for each pixel when the images f1 and g1 are shifted α, and −αin the x-direction, respectively. Similarly, the second term is aprediction value in the y-direction. The first term A(x, y) of thethreshold is provided for canceling α, β.

The second term B(x, y) of the right side of equations (22), (23) forthe calculation of thresholds is provided for allowing very small shiftof pattern edge, minute difference of pattern shape and patterndistortion. When the equation (24) for A(x, y) and equation (25) forB(x, y) are compared, it will be understood that B(x, y) is the absolutevalue of the prediction of gradation change of the difference image withaa, bb. If the known shift (regarded) is cancelled by A(x, y), theaddition of B(x, y) to A(x, y) means the shifting (regarded) of thealigned state by aa in the x-direction and by bb in the y-direction.That is, B(x, y) allows shifting aa in the x-direction and bb in they-direction.

The subtraction of B(x, y) from A(x, y) means the shifting of thealigned state by −aa in the x-direction and −bb in the y-direction.−B(x, y) allows shifting −aa in the x-direction and −bb in they-direction. Provision of upper and lower thresholds results in allowingthe shift of ±aa, ±bb. The allowance of shift can be controlled freelyby setting the parameters aa, bb at proper values.

The third term C(x, y) of equations (22), (23) for the calculation ofthresholds is provided for allowing the very small difference betweengradations. The addition of C(x, y) means allowing that the gradation ofg1 is C(x, y) larger than that of f1. The subtraction of C(x, y) meansallowing that the gradation of g1 is C(x, y) smaller than that of f1.Although C(x, y) in this embodiment is expressed by the sum of a typicalgradation (here the maximum) in a local region, multiplied by aproportional constant γ and a constant ε, it is not necessary to belimited to this function, but may be a function suitable for a known wayof gradation change, if present. If it is known that the variation widthis proportional to the square root of gradation, C(x,y)−(max1+max2)½*γ+ε should be used in place of the equation (26). As inB(x, y), the gradation difference allowance can be controlled freely byparameters γ, ε.

A defect decision circuit 50 receives the output sub(x, y) from thedifference extractor 49, and the outputs thL(x, y), thH(x, y) from thethreshold calculator 48, and decides if the following expression issatisfied.

thL(x,y)≦sub(x,y)≦thH(x,y)  (28)

That is, if the above condition is satisfied, the pixel at (x, y) isdecided not to be defective. If it is not satisfied, the pixel at (x, y)is decided to be defective. The defect decision circuit 50 thus producesa def(x, y) of 0 for the non-defective pixel or 1 or above for thedefective pixel.

A feature extractor 50 a makes noise removal process (for example,reduces/expands the def(x, y)), thereby eliminating noise output, andthen makes merging process for the neighboring defective pixels.Thereafter, it calculates amounts of various features such as thecenter-of-mass coordinates, XY projection length and area for each lump.

The whole controller 104 converts the coordinates of the defective partinto a coordinate system on the sample, thereby removing false defects,and finally collects defect data formed of position and amounts offeatures on the sample.

The defect data can be displayed or produced through the output means inthe same way as in the embodiment 1.

In addition, the image before gradation conversion or image data and theimage after gradation conversion or image data are displayed or theimage after gradation conversion or image data are displayed so that theoperator can visually confirm that the gradation conversion is properlymade for inspection.

According to this embodiment, since the total shift of a small region,very small shift of each pattern edge and a minute gradation differencecan be allowed, a correct part can be prevented from being recognized asdefect by mistake. Moreover, the allowance of shift and gradation changecan be easily controlled by parameters aa, bb, γ and ε.

Embodiment 3

FIG. 26 shows the third embodiment of a pattern defect inspection methodand apparatus according to the invention. Referring to FIG. 26, in whichlike elements corresponding to those in FIGS. 7 and 8 are provided,there are shown the image sensor 1 for producing a gradation imagesignal according to the brightness, or gradation of the reflected lightfrom the semiconductor wafer 4 that has patterns being inspected, theA/D converter 2 for converting the gradation image signal from the imagesensor 1 into the digital image signal 9, the delay memory 3 fordelaying the gradation image signal, the semiconductor wafer 4 havingthe patterns being inspected, and the stage 5 on which the semiconductorwafer 4 of the patterns being inspected is placed and which is moved inthe X-direction, Y-direction, Z-direction and θ-direction (rotation). Inaddition, there are shown the object lens 6 placed facing to thesemiconductor wafer 4, the light source 7 for illuminating thesemiconductor wafer 4 of the patterns being inspected, the half mirror 8for reflecting the illumination light to permit the light to passthrough the object lens 6 and illuminate the semiconductor wafer 4, andat the same time allowing the reflected light from the semiconductorwafer 4 to transmit therethrough, and the digital image signal 9produced from the A/D converter.

Thus, the illumination light from the light source 7 is reflected andpassed through the object lens 6 to illuminate the semiconductor wafer4, or making, for example, bright filed illumination to the wafer.

The delay memory 3 may be a memory for storing and delaying a pitch ofone cell or a plurality of cells repeated, of the image signal 9 or maybe a delay memory for storing and delaying a pitch of one chip or aplurality of chips repeated, of the image signal 9.

The block 11 is used to align the digital image signal 9 and the delayeddigital image signal 10. In this embodiment, it detects the amount ofshift at which the gradation difference between pixels is the minimum bynormalization correlation, and causes one image to shift on the basis ofthis amount of shift so that the two images can be aligned. Thenormalization is made in order to reduce the effect of the brightnessdifference between the images being aligned.

In other words, the stored image g(x, y) is shifted relative to thedetected image f(x, y), and the position at which the correlation valuebecomes the maximum is estimated from the following equations.

$\begin{matrix}{{R\left( {{\Delta \; x},{\Delta \; y}} \right)} = {\sum\limits_{x = 0}^{X - 1}{\sum\limits_{y = 0}^{Y - 1}\frac{\left\{ {{f\left( {x,y} \right)} - \overset{\_}{f}} \right\} \left\{ {{g\left( {{x + {\Delta \; x}},{y + {\Delta \; y}}} \right)} - {\overset{\_}{g}\left( {{\Delta \; x},{\Delta \; y}} \right)}} \right\}}{\sqrt{f\; {\sigma \cdot g}\; {\sigma \left( {{\Delta \; x},{\Delta \; y}} \right)}}}}}} & (29) \\{\mspace{79mu} {\overset{\_}{f} = {\frac{1}{X\; Y}{\sum\limits_{x = 0}^{X - 1}{\sum\limits_{y = 0}^{Y - 1}{f\left( {x,y} \right)}}}}}} & (30) \\{{\overset{\_}{g}\left( {{\Delta \; x},{\Delta \; y}} \right)} = {\frac{1}{X\; Y}{\sum\limits_{x = 0}^{X - 1}{\sum\limits_{y = 0}^{Y - 1}{g\left( {{x + {\Delta \; x}},{y + {\Delta \; y}}} \right)}}}}} & (31) \\{\mspace{79mu} {{f\; \sigma} = {\sum\limits_{x = 0}^{X - 1}{\sum\limits_{y = 0}^{Y - 1}\left\{ {{f\left( {x,y} \right)} - \overset{\_}{f}} \right\}^{2}}}}} & (32) \\{{g\; {\sigma \left( {{\Delta \; x},\; {\Delta \; y}} \right)}} = {\sum\limits_{x = 0}^{X - 1}{\sum\limits_{y = 0}^{Y - 1}\left\{ {{g\left( {{x + {\Delta \; x}},{y + {\Delta \; y}}} \right)} - {\overset{\_}{g}\left( {{\Delta \; x},{\Delta \; y}} \right)}} \right\}^{2}}}} & (33)\end{matrix}$

Here, although the image is continuously detected by the image sensor,the detected image is divided into lines as will be described later, andthe alignment is performed for line units. In the above equations, thedetected image has a size of X×Y pixels.

Although not shown, the normalization correlation for use in finding theimage shift need not be made for all image, but may be performed for,for example, small information-carrying images of K small parts (size ofX/K×Y pixels) into which a picture is divided in the longitudinaldirection of the image sensor.

The decision of whether there is information is made by, for example,differentiating each small image to detect the presence or absence of anedge, and selecting a small image having many edges. If the image sensoris a linear image sensor of multi-tap structure capable of paralleloutputs, the image from each tap output corresponds to the small image.This idea is based on the fact that the images from the parallel outputshave an equal shift. In addition, the image sensor used here may be anTDI, CCD image sensor of time delay integration type.

The gradation converter 13 converts the gradations of both image signalshaving a different brightness in order to make the brightness valuesequal. Here, linear conversion is performed for each pixel by gain andoffset to achieve the brightness matching.

$\begin{matrix}\begin{matrix}{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{{W\left( {x,y,{dx},{dy}} \right)} \cdot \left\{ {{f\left( {x,y} \right)} - {{a\left( {x,y} \right)} \cdot {g\left( {x,y} \right)}} - {b\left( {x,y} \right)}} \right\}^{2}}}} & (34) \\{{W\left( {x,y,{dx},{dy}} \right)} = {\max \left\lbrack {{1 - {\left( {{f\left( {x,y} \right)} - {g\left( {{x + {dx}},{y + {dy}}} \right)}} \right)^{2}/D^{2}}},0} \right\rbrack}} & (35)\end{matrix} & \; \\{{a\left( {x,y} \right)} = \frac{\begin{Bmatrix}{{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {{W\left( {x,y,{dx},{dy}} \right)} \cdot {f\left( {x,y} \right)} \cdot {g\left( {x,y} \right)}} \right)}} -} \\{\frac{1}{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{W\left( {x,y,{dx},{dy}} \right)}}} \cdot {\sum\limits_{x = {- {dx}}}^{dx}\sum\limits_{y = {- {dy}}}^{dy}}} \\\begin{bmatrix}{{W\left( {x,y,{dx},{dy}} \right)} \cdot {f\left( {x,y} \right)} \cdot} \\{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{{W\left( {x,y} \right)} \cdot {g\left( {x,y} \right)}}}}\end{bmatrix}\end{Bmatrix}}{\begin{Bmatrix}{{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {{W\left( {x,y,{dx},{dy}} \right)} \cdot {g\left( {x,y} \right)} \cdot {g\left( {x,y} \right)}} \right)}} -} \\{\frac{1}{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{W\left( {x,y,{dx},{dy}} \right)}}} \cdot {\sum\limits_{x = {- {dx}}}^{dx}\sum\limits_{y = {- {dy}}}^{dy}}} \\\begin{bmatrix}{{W\left( {x,y,{dx},{dy}} \right)} \cdot {g\left( {x,y} \right)} \cdot} \\{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{{W\left( {x,y} \right)} \cdot {g\left( {x,y} \right)}}}}\end{bmatrix}\end{Bmatrix}}} & (36) \\{{b\left( {x,y} \right)} = \frac{\begin{Bmatrix}{{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {{W\left( {x,y,{dx},{dy}} \right)} \cdot {f\left( {x,y} \right)}} \right)}} - {{a\left( {x,y} \right)} \cdot}} \\{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {{W\left( {x,y,{dx},{dy}} \right)} \cdot {g\left( {x,y} \right)}} \right)}}\end{Bmatrix}}{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{W\left( {x,y,{dx},{dy}} \right)}}}} & (37)\end{matrix}$

The converter 12 coverts both image signals having a differentbrightness in order to make the brightness values coincident. In thisembodiment, filtering operation is performed for all images to achievethe brightness matching.

The produced image signals are compared by the comparator 14. Aninconsistency, if present, is detected as a defect.

An image input unit 23 receives two images being compared. The inputimages are supplied to a scatter diagram generator 24, which thenproduces a scatter diagram. The scatter diagram shows the brightnessvalues of the two images on the ordinate and abscissa. The display 25indicates the produced scatter diagram. The input means 15 inputs, forexample, a threshold for the binary conversion of the absolute value ofa difference image, and plots a line segment of the inputted thresholdon the scatter diagram. Thus, whether the input threshold is appropriateor not can be decided easily by observing this scatter diagram. Also,with reference to the displayed scatter diagram, it is possible todetermine a threshold suitable for the images. One example of thescatter diagram will be shown in FIG. 33.

When W(x, y, dx, dy)=1, the following equations can be satisfied.

$\begin{matrix}{{a\left( {x,y} \right)} = \frac{\begin{Bmatrix}{{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {{f\left( {x,y} \right)} \cdot {g\left( {x,y} \right)}} \right)}} - {\frac{1}{\left( {{2\; {dx}} + 1} \right) \cdot \left( {{2\; {dy}} + 1} \right)} \cdot}} \\\left. {\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{\cdot {f\left( {x,y} \right)} \cdot {\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{g\left( {x,y} \right)}}}}}} \right)\end{Bmatrix}}{\begin{Bmatrix}{{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {{g\left( {x,y} \right)} \cdot {g\left( {x,y} \right)}} \right)}} - {\frac{1}{\left( {{2\; {dx}} + 1} \right) \cdot \left( {{2\; {dy}} + 1} \right)} \cdot}} \\\left. {\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{\cdot {g\left( {x,y} \right)} \cdot {\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{g\left( {x,y} \right)}}}}}} \right)\end{Bmatrix}}} & (38) \\{{b\left( {x,y} \right)} = \frac{\left\{ {\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{\left( {{f\left( {x,y} \right)} - {a\left( {x,y} \right)}} \right) \cdot {\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {g\left( {x,y} \right)} \right)}}}}} \right\}}{\left( {{2\; {dx}} + 1} \right) \cdot \left( {{2\; {dy}} + 1} \right)}} & (39)\end{matrix}$

In addition, a line segment is applied to the plotted data group on thescatter diagram by means of the method of least squares, and error canbe found as the deviation from this line segment.

If a straight line is expressed by Y=m·f(x, y)+n, the least squares (m,n) can be linearly approximated by the following equations.

$\begin{matrix}{m = \frac{\frac{\begin{matrix}{{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {{f\left( {x,y} \right)} \cdot {g\left( {x,y} \right)}} \right)}} -} \\{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{{f\left( {x,y} \right)}{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{g\left( {x,y} \right)}}}}}}\end{matrix}}{\left( {{2\; {dx}} + 1} \right) \cdot \left( {{2{dy}} + 1} \right)}}{{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{f\left( {x,y} \right)}^{2}}} - \frac{\left( {\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}{f\left( {x,y} \right)}}} \right)^{2}}{\left( {{2\; {dx}} + 1} \right) \cdot \left( {{2\; {dy}} + 1} \right)}}} & (40) \\{n = {\overset{\_}{g\left( {x,y} \right)} - {m \cdot \overset{\_}{f\left( {x,y} \right)}}}} & (41)\end{matrix}$

The error from the straight line is estimated from, for example, thefollowing equations.

$\begin{matrix}\begin{matrix}{{Vr} = {\frac{1}{{\left( {{2\; {dx}} + 1} \right) \cdot \left( {{2\; {dx}} + 1} \right)} - 1}{\sum\limits_{x = {- {dx}}}^{dx}\sum\limits_{y = {- {dy}}}^{dy}}}} \\{\left( {{m \cdot {f\left( {x,y} \right)}} + n - \left( {{m \cdot \overset{\_}{f\left( {x,y} \right)}} + n} \right)} \right)^{2}} \\{= {\frac{1}{{\left( {{2\; {dx}} + 1} \right) \cdot \left( {{2\; {dx}} + 1} \right)} - 1}{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {m \cdot \left( {{f\left( {x,y} \right)} - \overset{\_}{f\left( {x,y} \right)}} \right)} \right)^{2}}}}}\end{matrix} & (42) \\{{Ve} = {\frac{1}{{\left( {{2\; {dx}} + 1} \right) \cdot \left( {{2\; {dx}} + 1} \right)} - 2}{\sum\limits_{x = {- {dx}}}^{dx}{\sum\limits_{y = {- {dy}}}^{dy}\left( {{g\left( {x,y} \right)} - \left( {{m \cdot {f\left( {x,y} \right)}} + n} \right)} \right)^{2}}}}} & (43)\end{matrix}$

The threshold is calculated on the basis of this error, and can beplotted on the scatter diagram. For example, the threshold is a valueproportional to the square root of this Ve. FIG. 27 illustrates anexample of the structure for this.

A statistics calculator 26 makes the application to the line segment andcalculation of error from the segment. A threshold calculator 27computes a threshold from the produced statistics. Of course, anarrangement may be provided by which the user can input a threshold.

The images to be used on the scatter diagram are two images beingcompared, for example, images of pixel units after alignment. At eachstep of the image processing, two images can be supplied to the imageinput unit 23.

FIGS. 28 and 29 show examples of two images processed according to thesystem illustrated in FIG. 26. A pattern of lines and spaces is detectedon the lower right region of the images. The upper left region has nopattern. FIGS. 28 and 29 also show histograms of images in the course ofeach process, and statistics of different image. From the histograms, itwill be seen that the brightness values of two images are not coincidentat the first step.

First, a correlation value is estimated from the normalizationcorrelation, the position at which this correlation value is high isfound, and alignment is performed with an accuracy of pixel unit. Then,the two images aligned are subjected to local brightness correction thatis local gradation conversion. Finally, filtering is made to permit thetwo images to coincide in brightness, thereby further increasing thedegree of coincidence in the image brightness.

FIGS. 30˜32 show scatter diagrams of images at each step of process.Since the two images are not coincident in brightness at the stage wherethe images are aligned with an accuracy of pixel units, the valuesscatter out of the straight line of 45-degrees gradient on the scatterdiagrams. However, after the local gradation conversion, or localbrightness correction, and filtering process according to the invention,the values are distributed around the straight line on the scatterdiagram. Thus, from the scatter diagrams it will be understood thatthere is an effect of making the brightness values of the two imagesuniform. The gradient and intercept in the figures are the gradient andintercept of a line segment fitted to the data of scatter diagrams.

The gradient as the scale for the degree of coincidence between the twoimages was first 0.705, changed to 0.986 after the local gradationconversion, or local brightness correction, and arrived at 0.991 afterthe filtering process. Thus, it will be understood that the degree ofcoincidence between brightness values is improved.

Moreover, the value of Ve indicating the degree of coincidence betweenthe two images was first 40.02, changed to 8.598 after the localgradation conversion, or local brightness correction, and reached 7.477after the filtering process. Thus, the degree of brightness coincidenceis increased. The Ve value is not of all image, but is, for example, alinearly approximated error Ve of each region of 7×7 pixels includingthe surroundings of each pixel as illustrated in FIGS. 30˜32. From theimages, where the brightness matching error is large will be seen.

FIGS. 21˜23 show scatter diagrams of local contrast of images. In thisembodiment, the contrast is the difference between the maximum andminimum of the surroundings of each pixel, or for example 3×3 pixels.The local contrast after the local gradation conversion and filteringprocess according to the invention is distributed scatting near thestraight line on the scatter diagrams. The gradient and intercept havethe same meaning as in the previously given diagrams. The images of Vevalues are of linearly approximated Ve for a region of 7×7 pixelsincluding the surroundings of each pixel in the local contrast image.

FIGS. 33˜36 show examples of scatter diagrams and thresholds. In FIG.33, since two images are different, the threshold is set to be large forpreventing the erroneous detection of the images. FIG. 34 is a scatterdiagram after the local gradation conversion, or brightness correctionaccording to the invention. Since the degree of coincidence between thetwo images is high, the set threshold is small. FIG. 35 is a scatterdiagram after the brightness coincidence. The threshold is furtherreduced. FIG. 36 is a scatter diagram after the linear gradationconversion of one image for image unit not each pixel unit. Thethreshold has an offset on the scatter diagram.

FIG. 37 shows an example of divisional linear gradation conversion forimage unit. In this example, two divisions are shown.

The scatter diagram and threshold can be widely used for the standard todetermine a defect detection sensitivity or for the confirmation of ifthe established threshold is appropriate.

The generation and display of these scatter diagrams or the calculationof threshold using data of the scatter diagrams can be performed byusing images detected before the start of inspection. In addition, itwill be clear that if the generation of scatter diagrams and thresholdsetting are carried out for each image in synchronism with the imagedetection, the inspection can be conducted with high sensitivity. Theimage detection may be made after the completion of the respectiveprocesses. While the image process is achieved by the pipeline typeprocess as described above, it may be made by another arrangement.

Embodiment 4

FIG. 38 illustrates the fourth embodiment of a pattern defect inspectionmethod and apparatus according to the invention.

The construction shown in FIG. 38 is the same as that of FIG. 26 exceptfor the image brightness coincidence filter 12. In FIG. 38, likeelements corresponding to those in FIG. 26 are identified by the samereference numerals.

The operation of the arrangement shown in FIG. 38 is the same as in thethird embodiment in that the image sensor 1 generates a gradation imagesignal according to the brightness of the reflected light from thesemiconductor wafer 4 of patterns being inspected, and that the localgradation converter 13 makes linear conversion by gain and offset foreach pixel, thereby achieving brightness coincidence.

In this embodiment, the comparator 14 compares the image signalsproduced from the local gradation converter 13, thereby detecting aninconsistency as a defect. The detected image signal undergoes constantsequential processes of pipeline type, and finally the defect and itsfeatures are produced.

The operation of the inspection apparatus having the above constructionwill be described below.

Referring to FIG. 38, the illumination light focused by the object lens6 scans the stage 5 in the X direction (for example, in the directionperpendicular to the array direction of sensor chips on the sensorsurface of the on-dimensional image sensor 1) while the stage 5 is beingmoved at a uniform speed so that a necessary region of the semiconductorwafer 4 having patterns being inspected can be scanned by theillumination light. Consequently, the image sensor 1 detects thebrightness information (gradation image signal) of the memory mats 21and peripheral circuits 22 within the pattern formed on thesemiconductor wafer 4, or within the chip 20.

When the stage completes the movement of one row, it fast moves in theY-direction (perpendicular to the X-direction) to reach the start pointof the next row. In other words, while the image sensor 1 detects theimage of the pattern formed on the semiconductor wafer 4, the stage 5repeats the uniform movement along a row and fast movement for the startof the next row. Of course, the step and repeat type inspection may beemployed.

The A/D converter 2 converts the output (gradation image signal) fromthe image sensor 1 into the digital image signal 9. This digital imagesignal 9 is of 10 bits. Of course, if it has about 6 bits, it can bewell processed without problem. However, in order to detect a very smalldefect, the number of bits is required to be large to some extent. Thus,here a ten-bit format is used for somewhat margin.

Referring to FIG. 38, the coordinates of array data within the chip onthe semiconductor wafer 4 that are obtained on the basis of the designinformation are inputted by the input means formed of a keyboard ordisk. The CPU 16 generates defect inspection data according to theinputted coordinates of the array data within the chip on thesemiconductor wafer 4, and causes it to be stored in the memory 17. Thedefect inspection data stored has also data of defect reliability addedindicating the certainty of defect which will be described later.

This defect inspection data, if necessary, can be displayed on displaymeans or printed out by output means such as a printer together with thedefect reliability. The defect inspection data and defect reliabilitycan be transmitted by communication equipment to other inspectionapparatus, optical review apparatus, SEM type review apparatus or defectclassification apparatus (there are various different apparatus such asapparatus for classifying defect features into defect categories, andapparatus used in a neural network) or to external storage means such asa server. Of course, only the defect reliability may be displayed,printed out or supplied to other means.

The image input unit 23 is used to input two images being compared.These images are supplied to the scatter diagram generator 24, whichthen produces a scatter diagram. FIG. 39 shows how to generate thescatter diagram. The ordinate and abscissa in the scatter diagramindicate the two images f(x, y), g(x, y) being compared, respectively.The scatter diagram may show the local contrast of brightness or localaverage or a combination thereof on the ordinate and abscissa except thebrightness of image signals of patterns being inspected. The generatedscatter diagram is displayed with the frequency converted into gradationvalues as illustrated in FIG. 39. Here, the frequency of 0 is indicatedby gray, low frequency by white, and high frequency by black. Of course,the scatter diagram may illustrate only the presence or absence of data.

The calculator 26 calculates the frequency on the scatter diagram,function of position or relative distance on the scatter diagram orinformation referring to a look-up table from the above scatter diagramof image signals. The calculated information is added to theinconsistency information as defect reliability or as a scale for theinconsistency corresponding to a defect, and stored in the memory 17.

Here, a high frequency in the scatter diagram indicates that thecorresponding point is unlike defect. For example, the pixelcorresponding to the black data on the scatter diagram in FIG. 39 has ahigh frequency, and hence it seems a normal portion with a highprobability. The pixel corresponding to white data has a low frequencyand only a fraction of brightness, and hence it is a defect with a highprobability. Thus, the frequency information is an important parameterfor indicating the certainty of defect. Similarly, if the brightnessvalues of two images being compared are equal, those points aredistributed on a straight line having a gradient of 45 degrees on thescatter diagram. Therefore, the absolute positions on the scatterdiagram are also an important parameter for indicating the certainty ofdefect. The pixels corresponding to data deviating out of the straightline having a gradient of 45 degrees (not shown) have low frequencies,and thus they can be considered most probably as defects.

FIGS. 40A and 40B show straight lines estimated by the method ofweighted least squares using complex pixels in the area around eachaimed point. The relative distances of two images being compared are thedistances from the straight lines.

As illustrated in FIG. 40A, an approximate straight line is estimatedrelative to the data within an area set around each pixel on the scatterdiagram. Alternatively, a straight line of weighted least squares of twoimages being compared is estimated by using the fact that the frequencyis a parameter for indicating the certainty of defect, or by usingcomplex pixels in an area set around each point where the frequency is aconstant or above. The size of the area is locally changed according tothe frequency in the scatter diagram. It is flexible and desired toproduce the area size by inputting the frequency and referring to thelook-up table.

The distance from the approximate straight line is plotted as in FIG.40B, and this distance is regarded as the certainty of defect, and fedto the outside or displayed. The smaller the distance, the more probablythe image can be decided to be normal. The larger the distance, thecloser the image is to a defect.

From FIG. 40B, it will be seen that the frequency becomes small as thedistance from the approximate straight line increases, thus indicatingthat the certainty of defect increases. The points where the frequencyis a constant or above, for example 1 or below are considered as havinga high degree of certainty of defect, and thus removed from the regionof the approximate straight line. The local gradation converter 12 inFIG. 38 may estimate an approximate straight line for each pixel by themethod shown in FIGS. 40A and 40B and make gradation conversion on thebasis of the straight lines.

Moreover, the scattering of all image from the straight line can becomputed by the equations (42) and (43) used in the third embodiment.

This information can be used as a scale of the degree of coincidence inall image.

Thus, the certainty of inconsistency information produced from theinspection apparatus can be decided by use of the information obtainedfrom the scatter diagram.

The display 25 displays the generated scatter diagram alone or withother information. The input means 15 is used to input thresholds, forexample, a threshold for the binary conversion of the absolute value ofa difference image, and the line segment of the inputted threshold isplotted on the scatter diagram. By referring to this scatter diagram,the input threshold can be easily decided to be appropriate or not.

In addition, by referring to the information of the displayed diagram,it is possible to determine a threshold suitable for the image. In otherwords, if the threshold is determined according to the above-givencertainty of defect, defects can be detected with higher reliability.For example, a threshold is determined adequately for each pixel, oraccording to the frequency in the scatter diagram. The conversionbetween the frequency and the threshold is performed by using thelook-up table (LOT) as illustrated in FIG. 8. The contents of thelook-up table, or the way to convert is previously determined before theinspection.

As illustrated in FIG. 38, the images used in the scatter diagram, whichare two images being compared, for example, images of pixel units afteralignment, can be supplied to the image input unit 23 at each step ofthe image processing.

FIG. 42 shows an example of the process for the two images based on thesystem illustrated in FIG. 38. The processed portion is the inspectedpattern that has been flattened by CMP (chemical mechanical). The lineand space pattern (pattern of a large number of lines arranged with aconstant spacing) is detected at the lower right of the image. The upperleft region has no pattern. a histogram of images is also shown in thecourse of each process. From the histograms, it will be seen that at thefirst stage the brightness values of two images are not coincident.First, the correlation values of the images are estimated bynormalization correlation, the position where the correlation value ishigh is determined, and alignment of images is performed with anaccuracy of pixel units. Then, the two aligned images are subjected tolocal gradation conversion, or local brightness correction.

FIGS. 43A and 43B illustrate scatter diagrams of images. The two imagesare not coincident in brightness at the stage of alignment with anaccuracy of pixel units, and thus become scattering out of a straightline having a gradient of 45 degrees in the scatter diagram. However,after the local gradation conversion process (system based on theequations (34)˜(37)) according to the invention, the scatter diagram hasa distribution near the straight line. Thus, it will be understood thatthere is an effect in making the brightness values of two images equal.The gradient and interception are those of a line segment fitted to thedata of the scatter diagram.

According to the invention, the gradient as a scale of degree ofcoincidence between two images is 0.705 at fast and changed to 0.986after the local gradation conversion, or local brightness correction.Thus, the degree of coincidence between brightness values is increased.The above-mentioned Ve indicating the degree of coincidence between twoimages is 40.02 at first and changed to 8.598 after the local gradationconversion, or local brightness correction. The degree of coincidencebetween brightness values is improved.

Although these values are calculated for all images of image units beingcompared, the above Ve may be estimated for each local size beingconverted in gradation in the system shown in FIG. 40.

In the examples shown in FIGS. 43A and 43B, information of certainty ofdefect is added to the inconsistency by using the scatter diagram afterthe local brightness correction, and according to the above procedure.The pixels distributed around in the scatter diagram have a high degreeof certainty of defect. The threshold can be established by usingstraight lines having a gradient of 45 degrees to put the distributeddata therebetween. Of course, even at the stage where images are alignedwith an accuracy of pixel units, information of certainty of defect canbe similarly extracted from the scatter diagram. However, since thethreshold is determined to hold the distributed data therebetween, itcannot be estimated with high sensitivity.

Therefore, for determining a threshold it is more desirable to use ascatter diagram generated after the local brightness correction.

If the generation or display of the scatter diagram or the calculationof thresholds using data of the scatter diagram is performed for eachimage or each pixel of an image in synchronism with the image detection,the inspection can be made with high sensitivity. While the imageprocessing is of the pipeline type as described above, another type ofimage processing can be used.

FIGS. 44A˜44C show lists of defect output. The values listed areinconsistency outputs resulting from comparing the gradation-convertedimages by the comparator 14. The lists include the values of defectreliability in addition to the values indicating the defect number andthe features of defect such as coordinates, length and area. Here, thedefect number indicates the order in which the chips being inspectedwere scanned. The defect coordinates indicate the position at which adefect of a chip being inspected was detected in a coordinate systemwith, for example, an alignment mark or origin provided as a reference.The defect lengths are the lengths along the X-axis and Y-axis,respectively. Of course, the lengths along the major axis and minor axismay be calculated.

These units are, for example, microns depending on a necessaryprecision. The defect reliability is the information obtained from theabove-mentioned scatter diagram. For example, the defect reliability isexpressed by the frequency and distance from the approximate straightline on the scatter diagram of pixels of a defective image.

FIG. 44A is based on the frequency of a defective image in the scatterdiagram. The lower the frequency, the higher the defect reliabilityvalue. FIG. 44B is based on the distance from the approximate straightline of a defective image in the scatter diagram. The longer thedistance, the higher the defect reliability value. FIG. 44C is based onthe position of a defective image in the scatter diagram. Thereliability value of the defect is increased as the defect is separatedmore away from the straight line with a gradient of 45 degrees. Ofcourse, the defect reliability value may have a plurality of factorssuch as the frequency of a pixel of a defective image and the distancethereof from the approximate straight line on the scatter diagram. Ifthe defect covers a plurality of pixels, the amount of statistic iscalculated, such as the average, maximum or median of the frequencies ofthe pixels. Thus, the inconsistency information with the reliabilityadded can be used for the calculation of fatality of defect.

The fatality of defect is the fatality of defect to the inspectedpattern, depending on, for example, the size of defect and thecoordinates (region) in which the defect exists. The smaller the patternsize, the higher the fatality of the defect of the same size. If thisfatality is used with the reliability, the fatality can be decided withhigh precision. As a result, the defects of the inspected pattern can bemore accurately diagnosed by the processes.

A supplementary explanation will be made of the size of image. The sizeof image, or the unit of alignment (matching) of images can bedetermined by the following method. The amount of shift between twoimages being compared is estimated in units of fine divisions, asillustrated in FIG. 45. The amount of shift is, as illustrated, detectedseparately in the X-direction and Y-direction. This shift data can bespectrum-analyzed as shown by the waveform in FIG. 46. In thisspectrum-analyzed diagram, the ordinate indicates the spectrum density,and the abscissa the frequency.

In this figure, we consider the highest frequency with high density, or0.011. This frequency is determined by, for example, apparatuscharacteristic or vibration characteristic such as the travellingcharacteristic of the stage. The results of the spectrum analysisindicate that the shift between two images repeats at this frequency. Itis now assumed that the reciprocal of this frequency value, or 88 linesis a unit of image, or a unit of matching. If a large peak-to-peak valueof shift appears within an image, it is difficult to match both imageswith high precision. If the unit of image is assumed to be ¼ of thereciprocal of this frequency, the amount of shift can be reduced to ½ ofthe peak shift or below. In addition, the unit of image is made ⅛ thereciprocal of the frequency, the amount of shift can be reduced to ¼ thepeak shift or below.

Thus, as the image unit is decreased to a finer value, the precision ofmatching between the images should be able to be increased the more.However, the pattern information to be included within the image isdecreased, and as a result the image matching precision does notincrease. Therefore, from the results of the spectrum analysis the upperlimit of the image size can be determined by the necessary matchingprecision, and from the standpoint of assuring the pattern informationthe lower limit thereof can be decided by the pattern space information(information of the region with no pattern formed) depending on thepatterns being compared. While the highest frequency is considered inthe above description, the amount of shift and the frequencycorresponding to a large amount of shift may be considered, and in thiscase effective results can be obtained.

The above process may be made separately for the X-direction andY-direction or only for the stage movement direction as in the case ofan accumulation type linear image sensor.

The size of image at the step of gradation conversion may be made equalto the above-given image size in the system based on the equations (34)and (37) or may be determined locally as in the system mentioned withreference to FIG. 40.

According to the embodiments of the invention, the defects can bedetected with high sensitivity without being affected by the change ofpattern brightness at different places. In addition, the pattern withthe brightness greatly scattering in a dark region such as memory mats21 can be inspected with high sensitivity. The same effect can beexpected not only for the memory elements but for the logic elements inthe microcomputer or ASIC. Therefore, high-reliability inspection can beperformed as compared with the prior art.

While bright field illumination is employed in the above embodiments,microscope illumination such as dark field illumination or ring bandillumination may be used. The illumination used does not depend on theillumination length. In addition, the inspection may naturally use asecondary electron image on the sample surface that can be obtained bydetecting the secondary electrons emitted from the sample when anelectron beam is irradiated on the sample. Moreover, the inspection maybe made a plurality of times with the kind of illumination or theconditions of illumination changed, the results of the inspection beinglogically summed for the final result. Alternatively, the logicalproduct thereof is used to accurately detect defects. For example, theimage defect may be diagnosed by the defect distribution and number.Moreover, the detector is not limited to the linear image sensor, butmay be a TV camera by which the pattern image is detected. The kinds ofdefect may be a defective shape of short-circuit or open-circuit orother foreign bodies.

According to the above embodiments, more effective analyzing processescan be used.

By employing inspection data with reliability added, it is possible toexecute review of defects more effectively. For example, in the defectlists shown in FIGS. 44A˜44C, the order of defects is changed (sorting)according to the reliability of defects. For example, defects arerearranged in the order of higher certainty of defect. By thisarrangement, review of defects and confirmation can be performed in theorder of high reliability. It is possible not only to completely preventthe misdetection by the inspection apparatus, but to select theinconsistency on the boundary between the defect and the normal state.If the defect rearrangement is made according not only to thereliability but to the information of coordinates and size of thedefects, more effective defect review and confirmation can be performed.

In other words, the decision of fatality can be accurately executed bythe addition of reliability, and use of this fatality enables effectivedefect review and confirmation with higher precision. A threshold may beprovided for the reliability or fatality so that only the defects higherthan the threshold can be reviewed. Moreover, the same effect can beexpected for the classification of defects. In addition, yield diagnosisand prediction can be made without problem by use of only the truedefects. Thus, it is possible to reduce the load of the visuallyreviewing operation for the inconsistency, and increase the reliabilityof the yield prediction.

While the above embodiments of the invention mentioned above employ thecomparative inspection method chiefly using an optical microscope, otherscan type electron microscopes or other detectors using infrared lightor X-rays may be used with the same effect. In addition, while the aboveembodiments employ the method based on the comparison between images,the reliability of defects added to the defect information can beapplied to the apparatus of such type as foreign body inspectionapparatus in which scattered light detects a large area of body withoutuse of comparison.

According to the embodiments 1-4 of the invention, defects can bedetected with high sensitivity without being affected by the brightnesschange of pattern at each position. The pattern of which the brightnessgreatly scatters in the dark region such as memory mats 21 can beinspected with high sensitivity. Also, high-precision image matching canbe performed without being affected by the vibration characteristic ofequipment. Therefore, as compared with the prior art, the inspection canbe made with high reliability.

The contents of the specifications and drawings of Japanese PatentApplication Nos. 110383/1998 and 264275/1998 that are the basicapplications for the priority of this application are incorporated inthose of this application by this reference.

1. A method of inspecting a specimen, comprising: illuminating aspecimen, on which plural patterns are formed, with light emitted from alight source; capturing a first image of a first area of the specimen inwhich patterns are formed; capturing a second image of a second area ofthe specimen in which patterns which are essentially the same with thepatterns formed in the first area, are formed; creating data relating topixels of the first image and corresponding pixels of the second image,for each pixel; determining a threshold for each pixel for detectingdefects directly in accordance with the first image and the secondimage; and detecting defects on the specimen by processing said firstimage and the second image by using said threshold for each pixel andinformation of a scattered diagram of brightness of the first image andthe second image, wherein the threshold is determined by usinginformation of brightness of a local region of at least one of the firstimage and the second image, with the local region including an aimedpixel and peripheral pixels of the aimed pixel.
 2. A method ofinspecting a specimen according to claim 2, wherein said first image andsaid second image are both bright field images.
 3. A method ofinspecting a specimen according to claim 2, wherein said first image andsaid second image are both dark field images.
 4. A method of inspectinga specimen according to claim 2, wherein in the creating operation, saidpixel data includes brightness of the first image and brightness of thesecond image.
 5. An apparatus for inspecting a specimen, comprising: alight source which emits a light; an illuminator which illuminates aspecimen, on which plural patterns are formed, with light emitted fromthe light sources; an image capturing unit which captures a first imageof a first area of the specimen in which patterns are formed, and asecond image of a second area of the specimen in which patterns whichare essentially the same with the patterns formed in the first area, areformed; a pixel data creating unit which creates pixel data of the firstimage and corresponding pixel data of the second image, for each pixel;a threshold determining unit which determines a threshold for each pixelfor detecting defects directly in accordance with the first image andthe second image; and defect detecting unit which detects defects on thespecimen by processing said first image and the second image by usingsaid threshold for each pixel and information of a scattered diagram ofbrightness of the first image and the second image, wherein thethreshold is determined by using information of brightness of a localregion of at least one of the first image and the second image, with thelocal region including an aimed pixel and peripheral pixels of the aimedpixel.
 6. An apparatus for inspecting a specimen according to claim 6,wherein in said image capturing unit, said captured first image and saidsecond image are both bright field images.
 7. An apparatus forinspecting a specimen according to claim 6, wherein in said imagecapturing unit, said captured first image and said second image are bothdark field images.
 8. An apparatus for inspecting a specimen accordingto claim 6, wherein said pixel data creating unit creates said pixeldata of the first image including brightness of the first image and saidpixel data of the second image including brightness of the second image.9. A method of inspecting a specimen, comprising: illuminating aspecimen, on which plural patterns are formed, with light emitted from alight source; capturing a first bright field image of a first area ofthe specimen in which patterns are formed; capturing a second brightfield image of a second area of the specimen in which patterns which areessentially the same with the patterns formed in the first area, areformed; aligning the first bright field image and the second brightfield image with an accuracy of less than one pixel unit; creating datarelating to pixels of the first image and corresponding pixels of thesecond image which are aligned with the accuracy of less than one pixelto match a brightness between the first bright field image and thesecond bright field image; determining a threshold for each pixel fordetecting defects directly in accordance with the first image and thesecond image; and detecting defects on the specimen by processing saidfirst image and the second image by using said threshold for each pixeland information of a scattered diagram of brightness of the first imageand the second image, wherein the threshold is determined by usinginformation of brightness of a local region of at least one of the firstimage and the second image, with the local region including an aimedpixel and peripheral pixels of the aimed pixel.
 10. A method ofinspecting a specimen according to claim 10, wherein in the creatingoperation, the data relating to pixels of the first image includingbrightness of the first image and the data relating to pixels of thesecond image are both including brightness of the second image.
 11. Amethod of inspecting a specimen according to claim 2, wherein regardingan extent of which pixels are used, the thresholds are determined byusing information of brightness of only a local region of at least oneof the first image and the second image, with the local region includingonly the aimed pixel and the peripheral pixels of the aimed pixel. 12.An apparatus for inspecting a specimen according to claim 6, whereinregarding an extent of which pixels are used, the thresholds aredetermined by using information of brightness of only a local region ofat least one of the first image and the second image, with the localregion including only the aimed pixel and the peripheral pixels of theaimed pixel.
 13. A method of inspecting a specimen according to claim10, wherein regarding an extent of which pixels are used, the thresholdsare determined by using information of brightness of only a local regionof at least one of the first image and the second image, with the localregion including only the aimed pixel and the peripheral pixels of theaimed pixel.
 14. A method of inspecting a specimen according to claim 2,wherein the creating, determining and detecting operations are conductedvia pipeline-type image processing.
 15. An apparatus for inspecting aspecimen according to claim 6, wherein the pixel data creating unit,threshold determining unit and defect detecting unit operate viapipeline-type image processing.
 16. A method of inspecting a specimenaccording to claim 10, wherein the creating, determining and detectingoperations are conducted via pipeline-type image processing.